<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性布局</title>
</head>
<body>
    <style>
        .x{
            display: flex;
            width: 500px;
            height: 300px;
            background-color: aqua;
            margin: 10px;
        }
        .x span{
            width: 100px;
            height: 100px;
            background-color: red;
            margin: 20px;
        }
        .y{
            display: flex;
            flex-direction: column;
            width: 500px;
            height: 300px;
            background-color: aqua;
            margin: 10px;
        }
        .y span{
            width: 100px;
            height: 100px;
            background-color: red;
            margin: 20px;
        }

    </style>
    <p class="x">
        <span>1</span>
        <span>2</span>
    </p>
    <p class="y">
        <span>1</span>
        <span>2</span>
    </p>
    
</body>
</html>